package com.squapsource.project_euler;

import org.apache.commons.math.util.MathUtils;


public class Problem15 {
	private static final int SIZE = 20;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(MathUtils.binomialCoefficient(SIZE*2, SIZE));
		long paths = getPaths(0, 0);
		System.out.println(paths);
	}

	private static long getPaths(int x, int y) {
		if (x > SIZE || y > SIZE)
			return 0;
		if (x == SIZE && y == SIZE) {
			return 1;
		}
		return getPaths(x + 1, y) + getPaths(x, y + 1);
	}

}
